/**
 * Cube.window.Window
 * 
 * @class Cube.window.Window
 * @extends Cube.Component 
 */
Cube.define("Cube.window.Window", {
	extend: "Cube.Component",
	
	floating: true,
	
	minHeight: 50,
	minWidth: 50,
	
	height: 200,
	width: 400,
	
	constructor: function() {
		this.parent();
		
		this.addClass('x-cube-window');
		this.setupHeader();
		
		if (this.content)
		{
			var html = Cube.Loader.getFile('CustomView.html', this);
			
			this.setupContent(html);
		}
	},
	
	setupHeader: function() {
		var header = Cube.create("Cube.Component");
		
		header.css('background-color', 'green');
		header.setHeight(40);
		
		header.render(this.element);
		
		this.setDraggable({
			delegate: header
		});
	},
	
	setupContent: function(html) {
		var content = Cube.create("Cube.Component");
		content.render(this.element);
		content.setHtml(html);
	}
});